// 顶栏导航
<template>
  <div class="header-nav">
    <div class="aside-contend">
      <el-button
        plain
        icon="el-icon-menu"
        size="mini"
        @click="collapse"
      ></el-button>
      <!-- <span style="color: #fff">首页</span> -->
      <Breadcrumb></Breadcrumb>
    </div>
    <div class="user">
      <el-row class="block-col-2">
        <el-col :span="12">
          <el-dropdown trigger="click">
            <span class="el-dropdown-link">
              <img class="userImg" :src="userImg" />
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item>个人中心</el-dropdown-item>
              <el-dropdown-item>设置</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import { mapMutations } from "vuex";
import Breadcrumb from "./breadcrumb";
export default {
  data() {
    return {
      userImg: require("../assets/user.jpg"),
    };
  },
  components: {
    Breadcrumb,
  },
  methods: {
    ...mapMutations("nav", ["collapse"]),
  },
};
</script>
<style src='../style/init.css' scoped>
</style>
<style lang="less">
.header-nav {
  display: flex;
  height: 100%;
  align-items: center; //居中对齐弹性盒的各项 <div> 元素
  justify-content: space-between; //在弹性盒对象的 <div> 元素中的各项周围留有空白
  .aside-contend {
    display: flex;
    align-items: center;
    .el-button {
      margin-right: 20px;
    }
  }
  .user {
    line-height: 10px;
    margin-right: 20px;
    .el-dropdown {
      width: 40px;
      height: 40px;
      .userImg {
        width: 100%;
        height: 100%;
        border-radius: 50%;
      }
    }
  }
}
.el-dropdown-menu__item {
  width: 100px;
  text-align: center;
}
</style>